[Building Sakai] How to get Sakai Role from CM Role?

Brian Jones bjones86 at uwo.ca
Fri Jul 12 10:27:42 PDT 2013


Just in case anyone was curious about this, I was able to get the
SectionRoleResolver working via Spring injection:

<property name="sectionRoleResolver">
      	<bean
class="org.sakaiproject.coursemanagement.impl.provider.SectionRoleResolver"
init-method="init">
      		<property name="configuration"
ref="org.sakaiproject.coursemanagement.GroupProviderConfiguration" />
      	</bean>
      </property>

Brian Jones
Applications Development
Information Technology Services
Support Services Building, Room 4326
Western University
(519) 661-2111 x86969
bjones86 at uwo.ca

-----Original Message-----
From: sakai-dev-bounces at collab.sakaiproject.org
[mailto:sakai-dev-bounces at collab.sakaiproject.org] On Behalf Of Brian Jones
Sent: Thursday, July 11, 2013 1:44 PM
To: 'sakai-dev'
Subject: [Building Sakai] How to get Sakai Role from CM Role?

Hi,

I can access CM section membership/roles like this:

Set<Membership> sectionMembers =
courseManagementService.getSectionMemberships( sectionID ); For( Member
member : sectionMembers )
    String cmRole = member.getRole();

Member.getRole() returns the CM role, like 'I', or 'S'. But I need to
compare them to site roles like 'Instructor', and 'Student'.

I need to be able to access the CM Role to Site Role map, and I can see that
BaseRoleResolver has the method convertRole( String cmRole );

However, I'm not sure how to access this class. Do I need to inject it via
Spring in components.xml? Or can I just make my own instance whenever I need
it?

Any help is appreciated! Thanks,

Brian Jones
Applications Development
Information Technology Services
Support Services Building, Room 4326
Western University
(519) 661-2111 x86969
bjones86 at uwo.ca



_______________________________________________
sakai-dev mailing list
sakai-dev at collab.sakaiproject.org
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
with a subject of "unsubscribe"



More information about the sakai-dev mailing list