scaleway/apis/api_account.py
def perm_matches(self, request_perm, effective_perm):
        """ Evaluates whether `request_perm` is granted by `effective_perm`.

        Permissions are string separated by semi-colon characters.
        Checking of permissions is performed from left to right and stops at
        the first mismatch between `effective_perm` and `request_perm`.

        The `*` character is used to match all permissions at a given step in
        the permission validation process.

        Examples:
        >>> perm_matches('request:auth:read', 'request:auth:*')
        True
        >>> perm_matches('request:auth:read', 'request:*')
        True
        >>> perm_matches('request:auth:read', 'request:log:*')
        False
        >>> perm_matches('request:log:write', 'request:log:read')
        False

        :param request_perm: Currently granted permissions
        :param effective_perm: Actual permission granted to the token
        """
        if request_perm is None:
            return True

        request_perm_parts = request_perm.split(':')
        effective_perm_parts = effective_perm.split(':')

        for (request_perm_part,
             effective_perm_part) in zip_longest(request_perm_parts,
                                                 effective_perm_parts):

            if (
                request_perm_part != effective_perm_part and
                effective_perm_part != '*' and
                effective_perm_part is not None
            ):
                return False

        return True
 Evaluates whether `request_perm` is granted by `effective_perm`.

        Permissions are string separated by semi-colon characters.
        Checking of permissions is performed from left to right and stops at
        the first mismatch between `effective_perm` and `request_perm`.

        The `*` character is used to match all permissions at a given step in
        the permission validation process.

        Examples:
        >>> perm_matches('request:auth:read', 'request:auth:*')
        True
        >>> perm_matches('request:auth:read', 'request:*')
        True
        >>> perm_matches('request:auth:read', 'request:log:*')
        False
        >>> perm_matches('request:log:write', 'request:log:read')
        False

        :param request_perm: Currently granted permissions
        :param effective_perm: Actual permission granted to the token
        
Evaluates whether `request_perm` is granted by `effective_perm`.
Permissions are string separated by semi-colon characters.
Checking of permissions is performed from left to right and stops at
the first mismatch between `effective_perm` and `request_perm`.

The `*` character is used to match all permissions at a given step in
the permission validation process.


Evaluates whether ` request_perm ` is granted by ` effective_perm ` . Permissions are string separated by semi - colon characters . Checking of permissions is performed from left to right and stops at the first mismatch between ` effective_perm ` and ` request_perm ` . The ` * ` character is used to match all permissions at a given step in the permission validation process .
def perm_matches(self, request_perm, effective_perm):
        if request_perm is None:
            return True
        request_perm_parts = request_perm.split(':')
        effective_perm_parts = effective_perm.split(':')
        for (request_perm_part,
             effective_perm_part) in zip_longest(request_perm_parts,
                                                 effective_perm_parts):
            if (
                request_perm_part != effective_perm_part and
                effective_perm_part != '*' and
                effective_perm_part is not None
            ):
                return False
        return True
def perm_matches ( self , request_perm , effective_perm ) : if request_perm is None : return True request_perm_parts = request_perm . split ( ':' ) effective_perm_parts = effective_perm . split ( ':' ) for ( request_perm_part , effective_perm_part ) in zip_longest ( request_perm_parts , effective_perm_parts ) : if ( request_perm_part != effective_perm_part and effective_perm_part != '*' and effective_perm_part is not None ) : return False return True
Evaluates whether `request_perm` is granted by `effective_perm`.
Evaluates whether ` request_perm ` is granted by ` effective_perm ` .
""" Evaluates whether `request_perm` is granted by `effective_perm`.

        Permissions are string separated by semi-colon characters.
        Checking of permissions is performed from left to right and stops at
        the first mismatch between `effective_perm` and `request_perm`.

        The `*` character is used to match all permissions at a given step in
        the permission validation process.

        Examples:
        >>> perm_matches('request:auth:read', 'request:auth:*')
        True
        >>> perm_matches('request:auth:read', 'request:*')
        True
        >>> perm_matches('request:auth:read', 'request:log:*')
        False
        >>> perm_matches('request:log:write', 'request:log:read')
        False

        :param request_perm: Currently granted permissions
        :param effective_perm: Actual permission granted to the token
        """
self
request_perm
Currently granted permissions
Currently granted permissions
effective_perm
Actual permission granted to the token
Actual permission granted to the token