-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
options to auto-assign user roles based on a Shibboleth attribute
- Loading branch information
Ivan Novakov
committed
Dec 4, 2012
1 parent
39bb7e9
commit 85cb1b9
Showing
7 changed files
with
182 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,80 +11,81 @@ | |
* @author Ivan Novakov <[email protected]> | ||
*/ | ||
public final class Util { | ||
private Util() { | ||
} | ||
|
||
public static boolean isEnabled(long companyId) throws Exception { | ||
return GetterUtil.get( | ||
getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_ENABLED), | ||
ShibbolethPropsValues.SHIBBOLETH_ENABLED); | ||
} | ||
|
||
public static boolean isLogoutEnabled(long companyId) throws Exception { | ||
return GetterUtil.get( | ||
getValue(companyId, | ||
ShibbolethPropsKeys.SHIBBOLETH_LOGOUT_ENABLE), | ||
ShibbolethPropsValues.SHIBBOLETH_LOGOUT_ENABLE); | ||
} | ||
|
||
public static boolean importUser(long companyId) throws Exception { | ||
return GetterUtil.get( | ||
getValue(companyId, | ||
ShibbolethPropsKeys.SHIBBOLETH_USER_LDAP_IMPORT), | ||
ShibbolethPropsValues.SHIBBOLETH_USER_LDAP_IMPORT); | ||
} | ||
|
||
public static String getLogoutUrl(long companyId) throws Exception { | ||
return GetterUtil.getString( | ||
getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_LOGOUT_URL), | ||
ShibbolethPropsValues.SHIBBOLETH_LOGOUT_URL); | ||
} | ||
|
||
public static String getHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString( | ||
getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER); | ||
} | ||
|
||
public static String getEmailHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString( | ||
getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER_EMAIL), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER_EMAIL); | ||
} | ||
|
||
public static String getFirstnameHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString( | ||
getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER_FIRSTNAME), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER_FIRSTNAME); | ||
} | ||
|
||
public static String getSurnameHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString( | ||
getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER_SURNAME), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER_SURNAME); | ||
} | ||
|
||
public static boolean autoCreateUser(long companyId) throws Exception { | ||
return GetterUtil.get( | ||
getValue(companyId, | ||
ShibbolethPropsKeys.SHIBBOLETH_USER_AUTO_CREATE), | ||
ShibbolethPropsValues.SHIBBOLETH_USER_AUTO_CREATE); | ||
} | ||
|
||
public static boolean autoUpdateUser(long companyId) throws Exception { | ||
return GetterUtil.get( | ||
getValue(companyId, | ||
ShibbolethPropsKeys.SHIBBOLETH_USER_AUTO_UPDATE), | ||
ShibbolethPropsValues.SHIBBOLETH_USER_AUTO_UPDATE); | ||
} | ||
|
||
public static String getAuthType(long companyId) throws Exception { | ||
return GetterUtil.getString( | ||
getValue(companyId, PropsKeys.COMPANY_SECURITY_AUTH_TYPE), CompanyConstants.AUTH_TYPE_EA); | ||
} | ||
|
||
private static String getValue(long companyId, String key) throws Exception { | ||
return PrefsPropsUtil.getString(companyId, key); | ||
} | ||
private Util() { | ||
} | ||
|
||
public static boolean isEnabled(long companyId) throws Exception { | ||
return GetterUtil.get(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_ENABLED), | ||
ShibbolethPropsValues.SHIBBOLETH_ENABLED); | ||
} | ||
|
||
public static boolean isLogoutEnabled(long companyId) throws Exception { | ||
return GetterUtil.get(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_LOGOUT_ENABLE), | ||
ShibbolethPropsValues.SHIBBOLETH_LOGOUT_ENABLE); | ||
} | ||
|
||
public static boolean importUser(long companyId) throws Exception { | ||
return GetterUtil.get(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_USER_LDAP_IMPORT), | ||
ShibbolethPropsValues.SHIBBOLETH_USER_LDAP_IMPORT); | ||
} | ||
|
||
public static String getLogoutUrl(long companyId) throws Exception { | ||
return GetterUtil.getString(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_LOGOUT_URL), | ||
ShibbolethPropsValues.SHIBBOLETH_LOGOUT_URL); | ||
} | ||
|
||
public static String getHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER); | ||
} | ||
|
||
public static String getEmailHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER_EMAIL), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER_EMAIL); | ||
} | ||
|
||
public static String getFirstnameHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER_FIRSTNAME), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER_FIRSTNAME); | ||
} | ||
|
||
public static String getSurnameHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER_SURNAME), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER_SURNAME); | ||
} | ||
|
||
public static String getAffiliationHeaderName(long companyId) throws Exception { | ||
return GetterUtil.getString(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_HEADER_AFFILIATION), | ||
ShibbolethPropsValues.SHIBBOLETH_HEADER_AFFILIATION); | ||
} | ||
|
||
public static boolean autoCreateUser(long companyId) throws Exception { | ||
return GetterUtil.get(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_USER_AUTO_CREATE), | ||
ShibbolethPropsValues.SHIBBOLETH_USER_AUTO_CREATE); | ||
} | ||
|
||
public static boolean autoUpdateUser(long companyId) throws Exception { | ||
return GetterUtil.get(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_USER_AUTO_UPDATE), | ||
ShibbolethPropsValues.SHIBBOLETH_USER_AUTO_UPDATE); | ||
} | ||
|
||
public static boolean autoAssignUserRole(long companyId) throws Exception { | ||
return GetterUtil.get(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_USER_ROLE_AUTO_ASSIGN), | ||
ShibbolethPropsValues.SHIBBOLETH_USER_ROLE_AUTO_ASSIGN); | ||
} | ||
|
||
public static String autoAssignUserRoleSubtype(long companyId) throws Exception { | ||
return GetterUtil.get(getValue(companyId, ShibbolethPropsKeys.SHIBBOLETH_USER_ROLE_AUTO_ASSIGN_SUBTYPE), | ||
ShibbolethPropsValues.SHIBBOLETH_USER_ROLE_AUTO_ASSIGN_SUBTYPE); | ||
} | ||
|
||
public static String getAuthType(long companyId) throws Exception { | ||
return GetterUtil.getString(getValue(companyId, PropsKeys.COMPANY_SECURITY_AUTH_TYPE), | ||
CompanyConstants.AUTH_TYPE_EA); | ||
} | ||
|
||
private static String getValue(long companyId, String key) throws Exception { | ||
return PrefsPropsUtil.getString(companyId, key); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters