Create new group privileges

-if user creates group and does not have privileges for its management, he automatically becomes group manager of the newly created group.
Good point, but all methods in AuthzResolverBlImpl are static, so you 
can call them directly.
Also there is no way to have an interface for a static method.

On 20.10.2014 23:12, Simcsa wrote:
>> @@ -56,6 +56,24 @@ public Group createGroup(PerunSession sess, Vo vo, Group group) throws GroupExis
>>   		getPerunBl().getAuditer().log(sess, "{} created in {}.", group, vo);
>>   		group.setVoId(vo.getId());
>>
>> +		try {
>> +			Integer groupUid = group.getCreatedByUid();
>> +
>> +			if(groupUid != null) {
>> +				User user = perunBl.getUsersManagerBl().getUserById(sess, groupUid);
>> +
>> +				if(!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo)) {
>> +					AuthzResolver.setRole(sess, user, group, Role.GROUPADMIN);
>> +				}
>> +			}
>> +		} catch (UserNotExistsException e) {
>> +			//role not set
>> +		} catch (AlreadyAdminException e) {
>> +			throw new InternalErrorException("Inconsistency error: User is already group admin.");
>> +		} catch (PrivilegeException e) {
>
> I didn't use the AuthzResolver from blimpl package, because I couldn't get to it. Interface for AuthzResolverBlImpl is non-existent, I cannot get to any methods. Should I do another commit (in other words, another pull request) where I add the methods to the interface so that I can fix this commit?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/CESNET/perun/pull/519/files#r19114188
>