/modules/mod_admin/resources/resource_admin.erl
https://code.google.com/p/zotonic/ · Erlang · 36 lines · 13 code · 7 blank · 16 comment · 0 complexity · ef5855a9c8dafd01de578863bd27c784 MD5 · raw file
- %% @author Tim Benniks <tim@timbenniks.com>
- %% @copyright 2009 Tim Benniks.
- %% @doc Admin webmachine_resource.
- %% Copyright 2009 Tim Benniks
- %%
- %% Licensed under the Apache License, Version 2.0 (the "License");
- %% you may not use this file except in compliance with the License.
- %% You may obtain a copy of the License at
- %%
- %% http://www.apache.org/licenses/LICENSE-2.0
- %%
- %% Unless required by applicable law or agreed to in writing, software
- %% distributed under the License is distributed on an "AS IS" BASIS,
- %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- %% See the License for the specific language governing permissions and
- %% limitations under the License.
- -module(resource_admin).
- -author("Tim Benniks <tim@timbenniks.com>").
- -export([
- is_authorized/2
- ]).
- -include_lib("resource_html.hrl").
- is_authorized(ReqData, Context) ->
- z_acl:wm_is_authorized(use, z_context:get(acl_module, Context, mod_admin), ReqData, Context).
- html(Context) ->
- Template = z_context:get(template, Context, "admin.tpl"),
- Selected = z_context:get(selected, Context, "dashboard"),
- Html = z_template:render(Template, [{selected, Selected}], Context),
- z_context:output(Html, Context).