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
rp_st
12/30/2023, 7:06 AM
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
avi.f
12/30/2023, 7:08 AM
@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
rp_st
12/30/2023, 7:18 AM
1. For suspension, it’s better to put it in the access token payload since you need to check it in each api call
rp_st
12/30/2023, 7:19 AM
2. You can override the getPermissionsForRole function in the user roles recipe to have a role like that.
a
avi.f
12/30/2023, 7:20 AM
2. Ok thanks.
1. can I get a link to the docs how to do that?
Thanks again
r
rp_st
12/30/2023, 7:20 AM
There aren’t any docs on this specific use case I’m afraid
rp_st
12/30/2023, 7:20 AM
Checkout the override config in userroles.init on the backend
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).