Returns a list of all Permissions defined in the system.
@return a List of Permission objects
@since 1.1.0
550007
@SuppressWarnings("unchecked")
    public List<Permission> getPermissions() {
        final Query query = pm.newQuery(Permission.class);
        query.setOrdering("name asc");
        return (List<Permission>) query.execute();
    }
616806
private function getRolesPermissions()
    {
        return [
            [
                'name'        => 'Roles - List all roles',
                'description' => 'Allow to list all roles.',
                'slug'        => RolesPolicy::PERMISSION_LIST,
            ],
            [
                'name'        => 'Roles - View a role',
                'description' => 'Allow to view the role\'s details.',
                'slug'        => RolesPolicy::PERMISSION_SHOW,
            ],
            [
                'name'        => 'Roles - Add/Create a role',
                'description' => 'Allow to create a new role.',
                'slug'        => RolesPolicy::PERMISSION_CREATE,
            ],
            [
                'name'        => 'Roles - Edit/Update a role',
                'description' => 'Allow to update a role.',
                'slug'        => RolesPolicy::PERMISSION_UPDATE,
            ],
            [
                'name'        => 'Roles - Delete a role',
                'description' => 'Allow to delete a role.',
                'slug'        => RolesPolicy::PERMISSION_DELETE,
            ],
        ];
    }
574381
public java.util.List<IpPermission> getIpPermissionsEgress() {
        if (ipPermissionsEgress == null) {
            ipPermissionsEgress = new com.amazonaws.internal.SdkInternalList<IpPermission>();
        }
        return ipPermissionsEgress;
    }
158716
def get_details_permissions(self):
        
        l = {}

        for i in self.permissions:
            if i in self.permission_module:
                x = self.permission_module[i]
                l[i] = [x["protectionLevel"], x["label"], x["description"]]
            else:
                # FIXME: the permission might be signature, if it is defined by the app itself!
                l[i] = ["normal", "Unknown permission from android reference",
                        "Unknown permission from android reference"]
        return l
864901
@Override
	public synchronized List<Permission> getPermissions()
	{
		if (permissions == null || permissions.isEmpty())
			return null;

		return new ArrayList<Permission>(this.permissions);
	}
61085
public Collection<GrantedAuthority> getAuthorities() {
        Set<GrantedAuthority> authorities = new HashSet<GrantedAuthority>();
        for (Role role : Role.ROLE_USER.getRoleHierarchy()) {
            authorities.add(new SimpleGrantedAuthority(role.name()));
        }

        if (accountRights != null) {
            for (AccountRights rights : accountRights) {
                Set<Role> roles = rights.getRoles();
                if (roles != null) {
                    for (Role role : roles) {
                        authorities.add(role.authority());
                    }
                }
            }
        }

        if (isRoot()) {
            authorities.add(new SimpleGrantedAuthority(Role.ROLE_ROOT.name()));
        }
        return authorities;
    }
490875
public function getPermissionsAttribute()
    {
        $permissions = new Collection();

        foreach ($this->roles as $role) {
            foreach ($role->permissions as $permission) {
                $permissions->push($permission);
            }
        }

        return $permissions;
    }
278204
def permissions(self):
        
        # TODO: optimize this, it's kind of a bad solution for listing a mostly
        # static set of files.
        # We could either add a permissions dict as an attribute or cache this
        # in some way. Creating a dict would be another place we have to define
        # the permission, so I'm not a huge fan, but it would definitely be the
        # easier option.
        permissions_dict = {"self": {}, "parent": {}}

        for field in self.properties._meta.get_fields():
            split_field = field.name.split('_', 1)
            if len(split_field) <= 0 or split_field[0] not in ['self', 'parent']:
                continue
            permissions_dict[split_field[0]][split_field[1]] = getattr(self.properties, field.name)

        return permissions_dict
440501
def get_permissions(cls):
        
        perms = []
        for kls_name, kls in cls.registry.items():
            for method_name in cls.__dict__.keys():
                if method_name.endswith('_view'):
                    perms.append("%s.%s" % (kls_name, method_name))
        return perms
188370
private function getUsersPermissions()
    {
        return [
            [
                'name'        => 'Users - List all users',
                'description' => 'Allow to list all users.',
                'slug'        => UsersPolicy::PERMISSION_LIST,
            ],
            [
                'name'        => 'Users - View a user',
                'description' => 'Allow to view a user\'s details.',
                'slug'        => UsersPolicy::PERMISSION_SHOW,
            ],
            [
                'name'        => 'Users - Add/Create a user',
                'description' => 'Allow to create a new user.',
                'slug'        => UsersPolicy::PERMISSION_CREATE,
            ],
            [
                'name'        => 'Users - Edit/Update a user',
                'description' => 'Allow to update a user.',
                'slug'        => UsersPolicy::PERMISSION_UPDATE,
            ],
            [
                'name'        => 'Users - Delete a user',
                'description' => 'Allow to delete a user.',
                'slug'        => UsersPolicy::PERMISSION_DELETE,
            ],
        ];
    }
75321
public String[] getUserPermissionList(String userName) {
        if (!m_enabled) {
            return m_perm_list;
        }
        if (userName == null) {
            return new String[] {};
        }
        AuthUser user = getUser(userName);
        if (user == null) {
            return new String[] {};
        }
        return user.m_permissions_list;
    }
321896
public java.util.List<IpPermission> getIpPermissions() {
        if (ipPermissions == null) {
            ipPermissions = new com.amazonaws.internal.SdkInternalList<IpPermission>();
        }
        return ipPermissions;
    }
1242591
public function getUserPermissions()
    {
        $permissions = $this->getPermissions();

        if (!$this->isOwner()) {
            foreach (self::$ownerPermissions as $permission) {
                $key = array_search($permission, $permissions, true);
                if (false !== $key) {
                    unset($permissions[$key]);
                }
            }
        }

        return $permissions;
    }
12876
public function getAllPermissions()
    {
        $permissions = [];

        // Gather and combine all permissions for roles
        foreach ($this->roleModel->all() as $role) {
            $permissions = array_merge(
                $permissions,
                array_keys(array_filter($role->getPermissions()))
            );
        }

        // Gather permissions set specifically for users
        foreach ($this->userModel->all() as $user) {
            $permissions = array_merge(
                $permissions,
                array_keys(array_filter($user->getPermissions()))
            );
        }

        sort($permissions);

        return array_unique($permissions);
    }
559084
def get_all_permissions(self):
        """"""
        perms = set()
        for role in self.get_user_roles():
            for perm_view in role.permissions:
                t = (perm_view.permission.name, perm_view.view_menu.name)
                perms.add(t)
        return perms
473260
public java.util.List<String> getNetworkInterfacePermissionIds() {
        if (networkInterfacePermissionIds == null) {
            networkInterfacePermissionIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return networkInterfacePermissionIds;
    }
161243
public function getPermissions()
    {
        // return permissions if they have already been requested
        if(Session::get("usersPermission")) {
            self::$permissions = Session::get("usersPermission");
            return Session::get("usersPermission");
        }
        // return permissions if they have already been requested
        if(self::$permissions) {
            return self::$permissions;
        }

        $groupIDs = [];
        foreach (Auth::user()->roles as $group) {
            if ($group->isDefault) {
                self::$permissions["global"]["isDefault"] = true;
            }
            $groupIDs[] = $group->groupID;
        }

        $permissions = Permission::whereIn("groupID", $groupIDs)->get();

        // save values in keys & values for easy access
        foreach ($permissions as $permission) {
            self::$permissions[$permission->app][$permission->key] = [
              'value' => ($permission->ids !== null) ? array_values(json_decode($permission->ids, true)) : $permission->value,
              'hasAll' => $permission['hasAll']
            ];
        }
        Session::put("usersPermission", self::$permissions);
        return self::$permissions;
    }