com.arsdigita.acs
Class UserInfo
java.lang.Object
|
+--com.arsdigita.acs.UserInfo
- Direct Known Subclasses:
- GroupMember
- public class UserInfo
- extends Object
Class to abstract information about a user of the web service.
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UserInfo
public UserInfo(String email,
String passwd)
throws SQLException,
ACSException
- Validates a user login attempt. If successful, returns a new
UserInfo
instance. Otherwise, throws
ACSException
with a detail message, either
"password incorrect" or "user not found".
- Parameters:
email
- The user's email addresspasswd
- The user's supplied password, to validate- Throws:
ACSException
-
UserInfo
public UserInfo(String userId)
throws SQLException,
ACSException
UserInfo
public UserInfo(int userId)
throws SQLException,
ACSException
UserInfo
UserInfo(ResultSet rs)
throws SQLException,
ACSException
getUserId
public Integer getUserId()
- Returns:
- The user's user ID.
getFirstNames
public String getFirstNames()
- Returns:
- The user's first name.
getLastName
public String getLastName()
- Returns:
- The user's last name.
getFullName
public String getFullName()
- Returns:
- The user's full (first + last) name.
getEmail
public String getEmail()
- Returns:
- The user's email address.
getUserState
public String getUserState()
- Returns:
- The user's registration state
toString
public String toString()
- Overrides:
toString
in class Object
isGroupMember
public boolean isGroupMember(Object groupId)
throws SQLException,
ACSException
- Verifies that this user is a member of
groupId
.
- Returns:
true
if the user is a member of
groupId
; otherwise false
isGroupAdmin
public boolean isGroupAdmin(Object groupId)
throws SQLException,
ACSException
- Verifies that this user is an administrator of
groupId
.
- Returns:
true
if the user is a member of
groupId
; otherwise false
isAdministrationGroupMember
public boolean isAdministrationGroupMember(String module,
String sub)
throws SQLException,
ACSException
- Verifies that this user is a member of administration group for
the given module and submodule.
- Parameters:
module
- The modulesubmodule
- The submodule (or null/empty if none)- Returns:
true
if the user is a member of the
module
admin group; otherwise false
isSiteWideAdmin
public boolean isSiteWideAdmin()
- returns true if a user is a site-wide admin.