indexing description: "Community change group use case." author: "Marco Zietzling " date: "$Date$" revision: "$Revision$" class COMMUNITY_CHANGE_GROUP inherit AUTH_USE_CASE O_COMMUNITY_CONSTANTS O_CONFIG_CONSTANTS create make feature -- Access namespace: STRING is -- Namespace of this use case. once Result := community_namespace end type: STRING is -- Message type of this use case. once Result := community_change_group_type end feature -- Basic operation start (a_msg: O_MESSAGE) is -- Start the use case by a_msg. local l_msg: O_COMMUNITY_CHANGE_GROUP_MESSAGE do l_msg ?= a_msg check valid_message: l_msg /= Void end -- check if the user is authorized and act accordingly if l_msg.group = 0 or else l_msg.group = 7 then -- remove user from community (access_group=0) needs community_change_group permission -- becoming a member (access_group=7) needs community_change_group permission is_authorized_for_community (l_msg, "community_change_group", l_msg.community, auth_node) elseif l_msg.group = 6 then -- promote a member to admin (access_group=6) needs community_change_group_admin permission is_authorized_for_community (l_msg, "community_change_group_admin", l_msg.community, auth_node) end end feature {NONE} -- Implementation handle_auth_success (a_msg: O_MESSAGE) is -- a_msg has been authorized, execute it. do forward_to_node (a_msg, "storage1") end end