Answer the question
In order to leave comments, you need to log in
How to design an IPAM?
Hi,
I have a task to design an IP address distributor in any language; the software
should tightly pack everything
ready-made solutions. I can’t take
more details
. I'm stuck with the implementation of the algorithm for allocating free address ranges
Answer the question
In order to leave comments, you need to log in
We open the sources of nocproject and look at the implementation there.
SELECT users.name, permissions.name perm from users
inner join user_roles
on users.user_id=user_roles.user_fk
inner join roles
on roles.role_id=user_roles.role_fk
inner join role_permissions
on roles.role_id=role_permissions.role_fk
inner join permissions
on permissions.permission_id=role_permissions.permission_fk
having users.name='Ivan' and perm='auth-site'
I would do something like this:
SELECT
users.name
FROM users
INNER JOIN user_roles
ON user_roles.user_fk = users.user_id
INNER JOIN role_permissions
ON user_roles.role_fk = role_permissions.permission_fk
INNER JOIN permissions
ON user_roles.role_permission_id = permissions.id
WHERE
users.name='Ivan' AND permissions.name= 'auth-site'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question