def get_permissions(self, user, obj=_nothing):
rule = self._get_rule(obj)<EOL>all_permissions = (<EOL>attr[len('<STR_LIT>'):] for attr in dir(rule)<EOL>if attr.startswith('<STR_LIT>')<EOL>)<EOL>return set(<EOL>permission for permission in all_permissions<EOL>if self.allows(user, permission, obj)<EOL>)<EOL>
Returns permissions of a user.

        :param user: a user.
        :param obj: (optional) an object to get permissions for.