Hi, I have a situation where I limit the user to add X number of files to the server. I have created...
a
Hi, I have a situation where I limit the user to add X number of files to the server. I have created a permission of 'add_files', but how can I save the amount of files he can add to him self? is there a metadata place where I can put this to users that has
add_files
permission? I want to avoid:
add_files_1
,
add_files_2
,
add_files_3
and so... Thanks
r
Hey. You can save it in the user metadata recipe as have in the json. And then check that each time you want to check if the limit has reached.
a
@rp_st Thanks, 1. This is also where I should save an indication if the user is suspended? or on hold? 2. One more question if I may, is it possible to create a role that has all permissions implicitly? (by default). Thanks again
r
1. For suspension, it’s better to put it in the access token payload since you need to check it in each api call
2. You can override the getPermissionsForRole function in the user roles recipe to have a role like that.
a
2. Ok thanks. 1. can I get a link to the docs how to do that? Thanks again
r
There aren’t any docs on this specific use case I’m afraid
Checkout the override config in userroles.init on the backend
a
ok. appreceated!
7 Views