1 Reply Latest reply on Jun 17, 2008 6:27 PM by Jan Beest, te

    Give Identity some default permission

    Adrien Orsier Newbie

      Hi!


      I'd like to know if there's a proper and elegant way to give Identity some 'default' permission.
      I guess it goes by overriding RuleBasedIdentity, but I don't really understand how to add a permission to it (for example on @Create method).


      Thanks;

        • 1. Re: Give Identity some default permission
          Jan Beest, te Newbie

          Not much info to go by, but I guess you could create a rule that grants create on for instance role user.


          For instance to grant action create to all users with role user



          rule "User can always create"
            no-loop
            activation-group "permissions"
          when
            check: PermissionCheck(action == "create", granted == false);
            Role(name == "user");
          then
            check.grant();
          end



          Or you can leave out the Role(name == "user") completely to always grant action create (although I wouldn't recommend that :) )