View Single Post
  #3 (permalink)  
Old 07-24-2007, 05:58 AM
Shane Shane is offline
Junior Member
 
Join Date: Jul 2007
Posts: 7
Default

Due to time constraints we'll need to use the 4.2 method (running in the context of a web application with session state available).

We have used the test code below but we seem to missing something:
Code:
ExtendedPrincipal Principal = (ExtendedPrincipal)UserManager.AuthenticateUser("admin", "admin");
// below line is just for testing the UserManager.GetCurrentPrincipal();
// this will return null value like   logincachemanager=null,securitycache=null,sessiontokenprovider=null
IPrincipal IP = UserManager.GetCurrentPrincipal();
// below line is to check the authorization     running successfully not throwing any error.
if (!AuthorizationFactory.GetAuthorizationProvider().Authorize((Principal as ExtendedPrincipal), "Group.Create"))
{
throw new AuthorizationException();
}
// geting error in below line "You have not a permission to do that"
Group newgroup = Group.CreateGroup("AGroup", "A Group Description");
Group.Commit(newgroup);
 
stack trace :
Prezza.Framework.Security.AuthorizationException was unhandled by user code
  Message="You do not have permission to perform this operation."
  Source="Checkbox"
  StackTrace:
       at Checkbox.Users.Group.CreateGroup(String name, String description)

Also, we still need some sample code for sending an existing Invitation. We have determined the following:

There are 5 classes available related to invitation.
Classes Are:

Invitation
Invitationmanager
invitationsender
InvitationTemplate
InvitationRecieve

1. How can we use the method of these classes ?
We need either documentation or some sort of sample code.

2. Invitation INV = new Invitation(1003); where 1003 is the invitation id taking from table name ckbx_invitation

Error: Message = "DataID must be greater than zero."

3 There are Start,Stop,Resume,Dowork method available in Invitationsender class but not find out how can we use these method ?


Code:
Invitation INV_V=InvitationManager.GetInvitation(1003);
Stack Trace: 
[AuthorizationException: You do not have permission to perform this operation.]
   Checkbox.Panels.EmailListPanel..ctor() +116
Reply With Quote