-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restrict specific claim management endpoints for sub-organizations
- Loading branch information
1 parent
395077f
commit f63cf15
Showing
8 changed files
with
107 additions
and
3 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
38 changes: 38 additions & 0 deletions
38
.../api/server/claim/management/common/factory/OrganizationManagementOSGIServiceFactory.java
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.wso2.carbon.identity.api.server.claim.management.common.factory; | ||
|
||
import org.springframework.beans.factory.config.AbstractFactoryBean; | ||
import org.wso2.carbon.context.PrivilegedCarbonContext; | ||
import org.wso2.carbon.identity.organization.management.service.OrganizationManager; | ||
|
||
/** | ||
* Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to | ||
* instantiate the OrganizationManagementService type of object inside the container. | ||
*/ | ||
public class OrganizationManagementOSGIServiceFactory extends AbstractFactoryBean<OrganizationManager> { | ||
|
||
private OrganizationManager organizationManager; | ||
|
||
@Override | ||
public Class<?> getObjectType() { | ||
|
||
return Object.class; | ||
} | ||
|
||
@Override | ||
protected OrganizationManager createInstance() throws Exception { | ||
|
||
if (this.organizationManager == null) { | ||
OrganizationManager orgMgtService = (OrganizationManager) PrivilegedCarbonContext. | ||
getThreadLocalCarbonContext().getOSGiService(OrganizationManager.class, null); | ||
|
||
if (orgMgtService != null) { | ||
this.organizationManager = orgMgtService; | ||
} else { | ||
throw new Exception("Unable to retrieve Organization Management service."); | ||
} | ||
} | ||
return this.organizationManager; | ||
} | ||
} | ||
|
||
|
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