Commit 5f79129b authored by michael.simon's avatar michael.simon
Browse files

Bugfix set service password

parent 97a36435
......@@ -21,6 +21,7 @@ import edu.kit.scc.webreg.entity.RegistryEntity;
import edu.kit.scc.webreg.entity.RegistryStatus;
import edu.kit.scc.webreg.entity.ServiceEntity;
import edu.kit.scc.webreg.entity.UserEntity;
import edu.kit.scc.webreg.exc.NotAuthorizedException;
import edu.kit.scc.webreg.exc.RegisterException;
import edu.kit.scc.webreg.sec.AuthorizationBean;
import edu.kit.scc.webreg.service.RegistryService;
......@@ -73,7 +74,10 @@ public class SetServicePasswordBean implements Serializable {
userEntity = userService.findById(sessionManager.getUserId());
serviceEntity = registryEntity.getService();
if (! registryEntity.getUser().getId().equals(userEntity.getId()))
throw new NotAuthorizedException("Not authorized to view this item");
if (! authBean.isUserInService(serviceEntity))
throw new IllegalArgumentException("Not authorized for this service");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment