fixes #6015 Error when setting permissions on Employee Structure

Fixed the issue and pushed the code for review, please check it.