src/Searsaw/Drawbridge/models/BridgeUser.php
public function getRolesWithPermission($perm_id)
    {
        $roles = static::$app['db']->connection()
            ->table('roles_permissions')->where('permission_id', '=', $perm_id)->lists('role_id');

        $roles = array_map('intval', $roles);

        return $roles;
    }
public function getRolesWithPermission($perm_id)
    {
        $roles = static::$app['db']->connection()
            ->table('roles_permissions')->where('permission_id', '=', $perm_id)->lists('role_id');

        $roles = array_map('intval', $roles);

        return $roles;
    }
public function getRolesWithPermission ( $ perm_id ) { $ roles = static :: $ app [ 'db' ] -> connection ( ) -> table ( 'roles_permissions' ) -> where ( 'permission_id' , '=' , $ perm_id ) -> lists ( 'role_id' ) ; $ roles = array_map ( 'intval' , $ roles ) ; return $ roles ; }
Get the roles who have the given permission

@param $perm_id integer The ID of the permission

@return integer
Get the roles who have the given permission