How it works


The BDRoles tables has a set of default permissions for items, categories, et al.

Every object in the permission system (item, webcategory, customer, etc.) gets its starting permissions from these default permissions.

So if you make a brand new item, then go and view its permissions, you are going to see the permissions that it has based upon those default permissions without having to do anything else.

These permissions are not stored in any table except the BDRoles tables where it got its default permissions from. As long as the permissions on an object are the same as the default, you are not going to see any other data entries.

However, as soon as you start playing with permissions on an object and change them from the default and save them, then you are going to see entries for that object in the BDRolePermissions table.

This table has the following fields:

  • RoleID - Role that gets this permission
  • EntityType - Object that gets this permission
    • 1 - Item
    • 2 - WebCategory
    • 3 - Customer
    • 4 - Command
    • 5 - Location
    • 6 - FieldDefinition
  • EntityID - Object key such as the item number, webcategory Id, customer number, etc.
  • Rights - Bit masked set of permissions. If you want to give View, Buy, and Search you would take 2 (View) AND 8 (Buy) AND 16 (Search) = 26
    • 2 - View - Ability to see (or use, in the case of Commands)
    • 4 - Edit - Ability to make changes (this includes the ability to Add new)
    • 8 - Buy - Ability to purchase
    • 16 - Search - Ability to find in searches
    • 32 - Delete - - Ability to delete
    • 64 - View Details - Allows finer grain control such as the ability to see prices on items