Skip to content
Snippets Groups Projects
Commit 349c8135 authored by Martin Haase's avatar Martin Haase
Browse files

Two things:

1. If there is no resource a user can see (getObjects) an empty list is
returned from now on instead of a list with an empty element.
2. If a session does not exist (tgAddActiveRole) a fault is returned
instead of an empty response.


git-svn-id: https://textgridlab.org/svn/textgrid/trunk/middleware/tgauth@2164 7c539038-3410-0410-b1ec-0f2a7bf1c452
parent 14b5786b
No related branches found
No related tags found
No related merge requests found
...@@ -562,6 +562,13 @@ class TgExtra { ...@@ -562,6 +562,13 @@ class TgExtra {
} }
if( sizeof( $arrResource ) == 0 ) {
unset( $result->resource );
}
return $result; return $result;
} }
...@@ -1539,7 +1546,16 @@ class TgExtra { ...@@ -1539,7 +1546,16 @@ class TgExtra {
$username = ""; // The username corresponding to the session-ID $username = ""; // The username corresponding to the session-ID
$username = $this->rbac->sessionUser( $inRequest->auth ); try {
$username = $this->rbac->sessionUser( $inRequest->auth );
}
catch( Exception $e ) {
return new SoapFault( "rbacFault", $e->getCode(), get_class( $this->rbac ), $e->getMessage() );
}
if( preg_match( "/.+/", $username ) ) { if( preg_match( "/.+/", $username ) ) {
...@@ -1547,6 +1563,11 @@ class TgExtra { ...@@ -1547,6 +1563,11 @@ class TgExtra {
$result->result = $this->rbac->addActiveRole( $username, $inRequest->auth, $inRequest->role ); $result->result = $this->rbac->addActiveRole( $username, $inRequest->auth, $inRequest->role );
} }
else {
$result->result = false;
}
return $result; return $result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment