Skip to content

Commit

Permalink
Testing: Add type annotations to api/permission; rucio#6588
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimaio committed Apr 26, 2024
1 parent 2c389be commit ffbbed6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rucio/gateway/permission.py
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from copy import deepcopy
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Any

from rucio.common.exception import RSENotFound
from rucio.common.types import InternalAccount, InternalScope
Expand All @@ -26,7 +26,7 @@


@read_session
def has_permission(issuer, action, kwargs, vo='def', *, session: "Session"):
def has_permission(issuer: str, action: str, kwargs: dict[str, Any], vo: str = 'def', *, session: "Session") -> bool:
"""
Checks if an account has the specified permission to
execute an action with parameters.
Expand Down Expand Up @@ -66,6 +66,6 @@ def has_permission(issuer, action, kwargs, vo='def', *, session: "Session"):
for r in d['rules']:
r['account'] = InternalAccount(r['account'], vo=vo)

issuer = InternalAccount(issuer, vo=vo)
issuer_account = InternalAccount(issuer, vo=vo)

return permission.has_permission(issuer=issuer, action=action, kwargs=kwargs, session=session)
return permission.has_permission(issuer=issuer_account, action=action, kwargs=kwargs, session=session)

0 comments on commit ffbbed6

Please sign in to comment.