You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by David Wynter <da...@btclick.com> on 2001/11/01 18:53:29 UTC

Exception when using TurbineSecurity.grant()

Dear All,

I am not using Flux because I have a small number of permissions (2), roles
(2) and am using the global group. I set these up in a service that loads
when Turbine runs. I have to admit to not fully understanding the impact of
granting a user a particular role within a group. I have read the other
threads on Security and understand the concepts but the actual nitty gritty
I expect to find out by experimentation.

The exception is saying that the UserId cannot be null and occurs when I
call the last line of the code here.

	protected void setRoleFromParameters(RunData aData, User aUser)
		throws FkException, Exception
	{
		// Get the rolepeer from the role name parameter, not good to rely on
string here

		ParameterParser parser=aData.getParameters();
		String selectedRoleName=parser.getString("selectedRoleType");

		Role role=TurbineSecurity.getRole(selectedRoleName);
		// Assume that grant is benign if user exists with this role
		Group rwtgroup = TurbineSecurity.getGroup("global");
		TurbineSecurity.grant(aUser, rwtgroup,
role);<----------------------------------This is the line it fails on
	}

I am calling this from a method in th esame action that saves the User
object just prior to calling the above method. It does not faisl so I cannot
see how th eUserId can be null.

I have attached fuller details with the exception trace in a file for those
who need more.

Thanks

David