I received the following error:
2016-04-18 12:46:11,599 [main] ERROR .o.i.DefaultObservationManager - Failed
to lookup listeners 
org.xwiki.component.manager.ComponentLookupException: Failed to lookup
component [role = [interface org.xwiki.observation.EventListener] hint =
[default]]

I implemented the following component:

@Component
@Named("MyAuthorizationSettler")
@Singleton
public class MyAuthorizationSettler implements AuthorizationSettler {

    @Override
    public SecurityAccessEntry settle(UserSecurityReference
userSecurityReference, Collection<GroupSecurityReference> collection,
Deque<SecurityRuleEntry> deque) {
        System.out.println("settle");
        System.out.println("name");
        System.out.println(userSecurityReference.getName());
        System.out.println("space name");
       
System.out.println(userSecurityReference.getOriginalReference().getLastSpaceReference().getName());

        return new SecurityAccessEntry() {
            @Override
            public UserSecurityReference getUserReference() {
                return userSecurityReference;
            }

            @Override
            public SecurityAccess getAccess() {
                return null;
            }

            @Override
            public SecurityReference getReference() {
                return null;
            }
        };
    }
}

I added the folowing line 
0:com.raven.xwiki.auth.RavenAuthorizationSettler 
to components.txt file. 

Then I added to xwiki.properties file the following line: 
security.authorization.settler=com.raven.xwiki.auth.MyAuthorizationSettler

What should I need to implement else?




--
View this message in context: 
http://xwiki.475771.n2.nabble.com/What-is-the-right-way-to-implement-XWiki-custom-permission-check-in-java-code-tp7598878p7599032.html
Sent from the XWiki- Dev mailing list archive at Nabble.com.
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to