Package org.cyclos.impl.access
Class UserChannelServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.access.UserChannelServiceImpl
-
- All Implemented Interfaces:
UserChannelServiceLocal,UserChannelService,Service
@Service public class UserChannelServiceImpl extends BaseServiceImpl implements UserChannelServiceLocal
Implementation forUserChannelService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description UserChannelServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanenableChannel(User user, Channel channel)Makes sure that the given channel is enabled for the given user.List<Channel>getAccessibleChannels(BasicUser user)Returns a list with all accessible channels for the given user.UserChannelsDatagetChannelsData(UserLocatorVO locator)Returns data for viewing / editing the channels access for the given userbooleanisChannelAccessible(BasicUser user, Channel channel)Returns whether the given user can access the given channelprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidsaveChannels(UserLocatorVO locator, Set<ChannelVO> channelVOs)Saves the channels access for the given user.-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
enableChannel
public boolean enableChannel(User user, Channel channel) throws FrameworkException
Description copied from interface:UserChannelServiceLocalMakes sure that the given channel is enabled for the given user. Returns false when the channel cannot be enabled (is disabled by the configuration)- Specified by:
enableChannelin interfaceUserChannelServiceLocal- Throws:
FrameworkException
-
getAccessibleChannels
public List<Channel> getAccessibleChannels(BasicUser user) throws FrameworkException
Description copied from interface:UserChannelServiceLocalReturns a list with all accessible channels for the given user.- Specified by:
getAccessibleChannelsin interfaceUserChannelServiceLocal- Throws:
FrameworkException- See Also:
UserChannelServiceLocal.isChannelAccessible(BasicUser, Channel)
-
getChannelsData
public UserChannelsData getChannelsData(UserLocatorVO locator) throws FrameworkException
Description copied from interface:UserChannelServiceReturns data for viewing / editing the channels access for the given user- Specified by:
getChannelsDatain interfaceUserChannelService- Throws:
FrameworkException
-
isChannelAccessible
public boolean isChannelAccessible(BasicUser user, Channel channel) throws FrameworkException
Description copied from interface:UserChannelServiceLocalReturns whether the given user can access the given channel- Specified by:
isChannelAccessiblein interfaceUserChannelServiceLocal- Throws:
FrameworkException
-
saveChannels
public void saveChannels(UserLocatorVO locator, Set<ChannelVO> channelVOs) throws FrameworkException
Description copied from interface:UserChannelServiceSaves the channels access for the given user. Only the given channels will be accessible, however, some channels are enforcedly enabled or disabled on configurations. In those cases, those channels will be enabled / disable despite the ones set via this method.- Specified by:
saveChannelsin interfaceUserChannelService- Throws:
FrameworkException
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
-