Class AdminService
- java.lang.Object
-
- cz.zcu.students.cacha.bp_server.services.AdminService
-
@Service public class AdminService extends Object
Class represent service which is responsible for administrator operations
-
-
Constructor Summary
Constructors Constructor Description AdminService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserDetailVM
getUserDetail(Long userId)
Gets the details about given userList<UserVM>
getUsers()
Gets all users except adminsvoid
removeInstitution(Long userId)
Removes user's managerial rights to his institutionvoid
setBan(BooleanValVM booleanValVM, Long userId)
Changes if user is banned or not depending on given valuevoid
setTranslator(BooleanValVM booleanValVM, Long userId)
Changes the value of user translator rightsvoid
updateUserPassword(Long userId)
Generates new password for given user and sends it to his mailvoid
updateUserUsername(UsernameUpdateVM usernameUpdateVM, Long userId)
Updates username to given user
-
-
-
Method Detail
-
getUsers
public List<UserVM> getUsers()
Gets all users except admins- Returns:
- all users except admins
-
getUserDetail
public UserDetailVM getUserDetail(Long userId)
Gets the details about given user- Parameters:
userId
- user id- Returns:
- details about given user
-
updateUserUsername
public void updateUserUsername(UsernameUpdateVM usernameUpdateVM, Long userId)
Updates username to given user- Parameters:
usernameUpdateVM
- new usernameuserId
- user id
-
updateUserPassword
public void updateUserPassword(Long userId)
Generates new password for given user and sends it to his mail- Parameters:
userId
- user id
-
setTranslator
public void setTranslator(BooleanValVM booleanValVM, Long userId)
Changes the value of user translator rights- Parameters:
booleanValVM
- new user rights valueuserId
- user id
-
removeInstitution
public void removeInstitution(Long userId)
Removes user's managerial rights to his institution- Parameters:
userId
- user id
-
setBan
public void setBan(BooleanValVM booleanValVM, Long userId)
Changes if user is banned or not depending on given value- Parameters:
booleanValVM
- new ban valueuserId
- user id
-
-