Forum Discussion

VarunGrazitti's avatar
9 years ago

Setting permissions for a user via API

Is there a way we can set the user permissions for the user in context via API? e.g. there is a context object available to fetch if a user has permission to do a certain thing, which is permissions.hasPermission("permission_identifier")

 

any way I can use any such API to toggle the permission for a user in context? Like, disable kudos based on his login IP for a particular board?

  • Can you try creating new role, and then assign to your specific user and check for that role on login of every user.. I think you might get your group of users for particular board.
    • VarunGrazitti's avatar
      VarunGrazitti
      Boss
      Not an option, there would be ad hoc cases, so we can't create and manage so many roles
      • hayat_sama's avatar
        hayat_sama
        Guide
        you don't need to create role for every user, just create one and set permission as you like, then assign it to your ad hoc users so that they have specific rights as you nee.